package com.hdoit.apollo.web.stock.modelconfig;

import com.hdoit.apollo.web.purchase.providers.PurchaseProvider;
import com.hdoit.apollo.web.stock.providers.OutStockTypeProvider;
import com.hdoit.apollo.web.stock.providers.WarehouseProvider;
import com.tennetcn.core.common.enums.regular.MathRegularExpressions;
import com.tennetcn.web.component.attribute.DateTimeAttribute;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RegularExpressionAttribute;
import com.tennetcn.web.component.attribute.RequiredAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      tancongzhu
 * @email       
 * @createtime  2018年05月30日 09:49:20
 * @comment
 */
public class OutStockConfig extends ModelMetadataAttributeConfiguration{
    public OutStockConfig(){
        this.setProperty("outStockNum")
            .hasAttribute(new DisplayNameAttribute("出库数"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("outStockDebt")
            .hasAttribute(new DisplayNameAttribute("尚欠数"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("type")
            .hasAttribute(new DisplayNameAttribute("类型"))
        	.hasAttribute(new DropDownListAttribute(new OutStockTypeProvider()));

        this.setProperty("outStockState")
            .hasAttribute(new DisplayNameAttribute("出库状态"));

        this.setProperty("billingId")
            .hasAttribute(new DisplayNameAttribute("订单Id"));
        
        this.setProperty("purchaseId")
   		.hasAttribute(new DropDownListAttribute(new PurchaseProvider()))
        .hasAttribute(new RequiredAttribute("必填项"))
    	.hasAttribute(new DisplayNameAttribute("关联采购单号"));
	    
	    this.setProperty("outStockNo")
	    	.hasAttribute(new RequiredAttribute("必填项"))
			.hasAttribute(new DisplayNameAttribute("退货单号"));

	    
	    this.setProperty("warehouse")
	    	.hasAttribute(new DropDownListAttribute(new WarehouseProvider()))
	        .hasAttribute(new RequiredAttribute("必填项"))
			.hasAttribute(new DisplayNameAttribute("退货仓库"));

        this.setProperty("logisticsId")
            .hasAttribute(new DisplayNameAttribute("物流Id"));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店id"));

        this.setProperty("billingNo")
            .hasAttribute(new DisplayNameAttribute("关联单号"));

        this.setProperty("customerName")
            .hasAttribute(new DisplayNameAttribute("客户名称"));
        
        this.setProperty("comment")
		.hasAttribute(new DisplayNameAttribute("备注"));
    
	    this.setProperty("createUserName")
			.hasAttribute(new DisplayNameAttribute("经办人"));
	    
	    this.setProperty("createDate")
	        .hasAttribute(new DisplayNameAttribute("日期"))
	        .hasAttribute(new DateTimeAttribute());

    }
}
